window.onload=function  (){ 
	var column=document.getElementsByClassName('column');
	var click=document.getElementsByClassName('click');
	var left2 = document.getElementById('left2');
	var right2 = document.getElementById('right2');
	var menu_list=document.getElementById('li1001');
	var li1002=document.getElementById('li1002');
	var li1003=document.getElementById('li1003');
	var li1004=document.getElementById('li1004');
	var li1005=document.getElementById('li1005');
	var num=0;
	var cnt = 0;
	var car_border=document.getElementById('car_border');
	var son1=document.getElementById('son1');
	var son2=document.getElementById('son2');
	var son3=document.getElementById('son3');
	var son4=document.getElementById('son4');
	var son5=document.getElementById('son5');
	var car=document.getElementById('car');
	var car_sub=document.getElementById('car_sub');
	var imglist = document.getElementById('imglist');
	var left1=document.getElementById('left1');
	var right1=document.getElementById('right1');
	var main=document.getElementById('main');
	var c = 0;
	
	// var ul1000=document.getElementById('ul1000');
	var imgbackground = ['#B6C64E','#C2F3FE','#F9F8FC','#FFFFFF','#262729','#EAE9EB'];
	// 定义背景颜色
	var run=function  () {
		cnt =0;
		for (var i = 0;i<column.length;  i++) {
			column[i].style.display='none';
			click[i].style.backgroundColor='';
		};
		column[num].style.display='block';
		click[num].style.backgroundColor='#00C3F5';
		column[0].parentNode.parentNode.style.backgroundColor=imgbackground[num];
		num++;
		if (num==column.length) {
			num=0;
		};
		// alert(num);
	}
	

	var sun=function  () {
		if (num==-1) {
			num=0;
		}
		if (num==0) {
			num=column.length-1;
		}
		if (num==-2) {
			num=column.length-1;
		}
		if (num==0) {
			num=column.length-1;
		}
		if(cnt==0){
			num -=2;
			cnt =1;
		}

		for (var i = 0;i<column.length;  i++) {
			column[i].style.display='none';
			click[i].style.backgroundColor='';
		};
		column[num].style.display='block';
		click[num].style.backgroundColor='#00C3F5';
		column[0].parentNode.parentNode.style.backgroundColor=imgbackground[num];
		num--;

		if (num==-1) {
			num=column.length-1;
		};

		
	}

	run();
	var time=setInterval(run,1000);
	var father = document.getElementById('main');
	father.onmouseover = function  () {
		 clearInterval(time);
		left2.style.backgroundColor='#858585';
		right2.style.backgroundColor='#858585';

		// 鼠标进入main标签里面后清除计时器
	}
	// 执行计时器


	



	
	var father2=document.getElementById('li1001');
	var father3=document.getElementById('li1002');
	var father4=document.getElementById('li1003');

	var father5=document.getElementById('li1004');

	var father6=document.getElementById('li1005');
	var father7=document.getElementById('car');

	
	father2.onmouseover = function  () {
		
		son1.style.display='block';

		// 鼠标进入main标签里面后清除计时器
	}
	father3.onmouseover = function  () {
		
		son2.style.display='block';

		// 鼠标进入main标签里面后清除计时器
	}
	father4.onmouseover = function  () {
		
		son3.style.display='block';

		// 鼠标进入main标签里面后清除计时器
	}
	father5.onmouseover = function  () {
		
		son4.style.display='block';

		// 鼠标进入main标签里面后清除计时器
	}
	father6.onmouseover = function  () {
		
		son5.style.display='block';

		// 鼠标进入main标签里面后清除计时器
	}
	father7.onmouseover = function  () {
		
		car_sub.style.display='block';
		

		// 鼠标进入main标签里面后清除计时器
	}

	father.onmouseout=function  () {
		time=setInterval(run,1000);
		left2.style='none';
		right2.style='none';
		// 鼠标离开main标签后重新开始计时器
	}
	father2.onmouseout=function  () {
		son1.style.display='none';
		// 鼠标离开main标签后重新开始计时器
	}
	father3.onmouseout=function  () {
		son2.style.display='none';
		// 鼠标离开main标签后重新开始计时器
	}
	father4.onmouseout=function  () {
		son3.style.display='none';
		// 鼠标离开main标签后重新开始计时器
	}
	father5.onmouseout=function  () {
		son4.style.display='none';
		// 鼠标离开main标签后重新开始计时器
	}
	father6.onmouseout=function  () {
		son5.style.display='none';
		// 鼠标离开main标签后重新开始计时器
	}
	father7.onmouseout=function  () {
		car_sub.style.display='none';
		// car_border.style.borderTop='block';
		// car_border.style.borderTop.='block'
		// 鼠标离开main标签后重新开始计时器
	}

	car=document.getElementById('car');
	$(function  () {
	$('.header .header_column .header_column_mid_left .header_column_mid_left_sub').hover(function() {
		$(this).children('.header_column_mid_left_son').show();
	}, function() {
		$(this).children('.header_column_mid_left_son').hide();
	});

	})

	for (var i = 0; i < click.length; i++) {
		dian(i);
	};

	function dian (i) {
		click[i].onclick =function() {
			num=i;
			run();
		}
	}
	
	left2.onclick = function  (argument) {
		sun();
	}

	right2.onclick = function  (argument) {
		// alert(num);
		run();
	}


	// $(function  () {
	// $('.header .header_subnav_menu .menu_list').hover(function() {
	// 	$(this).children('.son').show();
	// }, function() {
	// 	$(this).children('.son').hide();
	// 	});
	// })
	// // 鼠标移入弹出
	
	
	window.onscroll = function(){ 
	var t = document.documentElement.scrollTop || document.body.scrollTop; 
	var top_div = document.getElementById( "top_div" ); 
	if( t >= 300 ) { 
	top_div.style.display = "block"; 
	} else { 
	top_div.style.display = "none"; 
	} 
	} 



	
	

	var cun = function () {
		if(c==0){
			imglist.style.left='-1240px';
			c=1;
		}else{
			imglist.style.left='0px';
			c=0;
		}
	}

	var time2 = setInterval(cun, 2000);

	imglist.onmouseover = function  () {
		clearInterval(time2);
	}
	left1.onmousemove=function  () {
		clearInterval(time2);
	}
	right1.onmousemove=function  () {
		clearInterval(time2);
	}
	imglist.onmouseout = function  () {
		time2 = setInterval(cun, 2000);
	}
	left1.onmouseout=function  () {
		time2 = setInterval(cun, 1000);
	}
	right1.onmouseout=function  () {
		time2 = setInterval(cun, 1000);
	}
	left1.onclick = function  () {
		if(c==0){
			imglist.style.left='-1240px';
		}
	}

	right1.onclick = function  () {
		if(c==1){
			imglist.style.left='0px';
		}
	}
}





